'''
main.py

Main file for 2 Pints
2 Pints is an implementation of Quarto written in Python

Dave Schwantes
2010
www.dinosaurseateverybody.com
'''

from QuartoGame import *

def main():
    print "2 Pints"
    print "a Quarto implementation by Dave Schwantes"
    print ""
    game = QuartoGame()
    
    print "The Board:"
    game.displayBoard()
    print ""
        
    while not game.isGameOver():
        print "Available Pieces:"
        game.displayAvailablePieces()
        print ""
        print "Player %i select a piece:" % (game.turn)
        selected_piece = input()
        game.selectPiece(selected_piece)
        
        game.nextTurn()
        
        print "Selected Piece:"
        game.selectedPiece.displayPiece()
        
        print "Player %i select x for piece:" % (game.turn)
        x = input()
        print "Player %i select y for piece:" % (game.turn)
        y = input()
        
        game.placePiece(x,y)
        
        game.displayBoard()
        print ""        
        
    print "Game Over"
    print "Winner: player %i" % (game.turn)
        

if __name__ == '__main__':
    main()